#ifndef TCPSEV_H
#define TCPSEV_H

#include <QWidget>
#include <QTcpServer>
#include <QTcpSocket>
#include <QAbstractSocket>
#include "assert.h"
#include <QDebug>
#include <QSound>
#include "menu.h"
#include <ctime>
#include "map.h"

class TCPsev : public QWidget
{
    Q_OBJECT
public:
    explicit TCPsev(QWidget *parent = nullptr);
    Map map;

private:
    QTcpServer* mysever;
    QTcpSocket* mysocket;
    int razon = 0;

    int generateTip()
    {
        qsrand(time(NULL));
        return (qrand()%2);
    }

    //Menu *mymenu;


private slots:
    void dispErr(QAbstractSocket::SocketError tErr);

public slots:
    void send_start();
    void disconnectClient();

signals:
    void changeRoad(int i , int j , int& k);
    void noticSound();

    void setTips(int tips);

};

#endif // TCPSEV_H
